package com.jun.dao;

import com.jun.mapper.DepartmentMapper;
import com.jun.pojo.Department;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.Collection;
import java.util.HashMap;
import java.util.Map;

/**
 * @author Zhang Jun
 * @date 2022/9/6 11:02
 */
// 部门dao
@Repository
public class DepartmentDao {
    @Autowired
    DepartmentMapper departmentMapper;

    // 获得所有部门信息
    public Collection<Department> getDepartments(){
        return departmentMapper.queryDeptList();
    }

    // 通过id得到部门
    public Department getDepartmentById(Integer id){
        return departmentMapper.queryDeptById(id);
    }


}
